#include <tuple>
#include <string>
#include <iostream>

// 定义一个函数，返回一个元组
std::tuple<int, double, std::string> getValues() {
    // 返回包含整数、浮点数和字符串的元组
    return std::make_tuple(20, 6.28, "Another tuple");
}

int main() {
    // 创建元组
    std::tuple<int, double, std::string> myTuple = std::make_tuple(10, 3.14, "Hello, tuple!");

    // 访问元组中的数据
    std::cout << "Integer value: " << std::get<0>(myTuple) << std::endl;
    std::cout << "Double value: " << std::get<1>(myTuple) << std::endl;
    std::cout << "String value: " << std::get<2>(myTuple) << std::endl;

    int a;
    double b;
    std::string c;

    // 调用getValues函数，使用std::tie来解包元组
    std::tie(a, b, c) = getValues();

    // 输出从getValues返回的值
    std::cout << a << ", " << b << ", " << c << std::endl;

    return 0;
}